package com.onlinesshop.mall.service.impl;

import com.onlinesshop.mall.dao.ShopCartDao;
import com.onlinesshop.mall.pojo.ShopCart;
import com.onlinesshop.mall.service.ShopCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 叶建雄
 * @date 2019/12/25 18:27
 */
@Service
public class ShopCartServiceImpl implements ShopCartService {

    @Autowired
    private ShopCartDao shopCatDao;
    @Override
    public List<ShopCart> findAllShopByUserID(int id) {
        return shopCatDao.findAllShopByUserID(id);
    }

    @Override
    public ShopCart findByShopCart(ShopCart shopCart) {
        return shopCatDao.findByShopCart(shopCart);
    }

    @Override
    public void saveByShopCart(ShopCart shopCart) {
        shopCatDao.saveByShopCart(shopCart);
    }

    @Override
    public void updateByShopCart(ShopCart shopCart) {
        shopCatDao.updateByShopCart(shopCart);
    }

    @Override
    public int addShopCartProductQuantity(int id) {
        return shopCatDao.addShopCartProductQuantity(id);
    }

    @Override
    public int reduceShopCartProductQuantity(int id) {
        return shopCatDao.reduceShopCartProductQuantity(id);
    }

    @Override
    public int delShopCartProduct(int id) {
        return shopCatDao.delShopCartProduct(id);
    }

    @Override
    public int checkedShopCartProduct(int id) {
        return shopCatDao.checkedShopCartProduct(id);
    }

    @Override
    public int checkShopCartProduct(int id) {
        return shopCatDao.checkShopCartProduct(id);
    }

    @Override
    public void updateFlagByProIds(List<Integer> idList) {
        shopCatDao.updateFlagByProIds(idList);
    }


}
